<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:s="http://jboss.com/products/seam/taglib">

  <ui:composition template="template.xhtml">
    <ui:define name="content">
      
      <div class="errors"><h:messages globalOnly="true"/></div>       

      <s:div rendered="#{selectedMember == null}">
        Sorry, but this member does not exist.
      </s:div>
    
      <s:div rendered="#{selectedMember != null}">
      
        <s:div id="blogMemberCard">	        
	        <s:link view="/profile.seam" propagation="none">
	          #{selectedMember.memberName}<br/>
              <h:graphicImage value="/content/images?id=#{selectedMember.picture.imageId}&amp;width=90"/>	          
	        </s:link>
                           
          <br style="clear:both"/>          
        </s:div>

				<s:div id="blog">
	        <ui:repeat value="#{memberBlogs}" var="memberBlog">
	          <div class="blogEntry">
  	          <div class="blogDate">#{memberBlog.formattedEntryDate}</div>
	            <div class="blogTitle">#{memberBlog.title}</div>
	            <div class="blogText"><s:formattedText value="#{memberBlog.text}"/></div>
	            <div class="blogFooter">

	              [<s:link view="/blogentry.seam" propagation="none">
	                <f:param name="name" value="#{selectedMember.memberName}"/>
	                <f:param name="blogId" value="#{memberBlog.blogId}"/>
  	              #{memberBlog.commentCount} Comment#{memberBlog.commentCount != 1 ? "s" : ""}
  	             </s:link>]
	              
	              <s:span rendered="#{s:hasPermission('blog','createComment')}">
	                [<s:link view="/comment.seam" value="Add Comment" propagation="none">
	                   <f:param name="name" value="#{selectedMember.memberName}"/>
	                   <f:param name="blogId" value="#{memberBlog.blogId}"/>
	                 </s:link>]
	              </s:span>
	            </div>
	          </div>
	        </ui:repeat>
	      </s:div>
                
      </s:div>  
      
      <br class="clear"/>                    
          
    </ui:define>
    
  </ui:composition>
</html>
